package com.lyx.question.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.lyx.common.constant.QuestionRecordConstant;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 14667
 * @date 2022/7/25 17:26
 */
@Data
@TableName("question_record")
public class QuestionRecord {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 完成状态
     */
    private Integer doneStatus = QuestionRecordConstant.NOT_DONE_STATUS;
    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 题目id
     */
    private Integer questionId;

    /**
     * 试卷id
     */
    private Integer paperId;

    /**
     * 问题类型
     */
    private Integer questionType;

    /**
     * 章节id
     */
    private Integer chapterId;

    /**
     * 用户答案
     */
    private String userAnswer;
    /**
     * 问题描述
     */
    private String questionDescription;
    /**
     * 选项
     */
    private String choices;
    /**
     * 题号
     */
    private Integer number;
    /**
     * 标记
     */
    private Integer mark = QuestionRecordConstant.NOT_MARK_STATUS;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
